package simplifiedPastry.simulation;

import java.io.Serializable;

public class RegistratorData implements Serializable {
	private static final long serialVersionUID = 177181794414174440L;
	
	private int sendNum;
	private int kSearchNum;
	private int sendNumTimeout;
	private int kSearchTimeout;
	private int nodeNotFound;
	
	public RegistratorData() {
		sendNum = kSearchNum = sendNumTimeout = kSearchTimeout = nodeNotFound = 0;
	}
	
	public RegistratorData(int sendNum, int kSearchNum, int sendNumTimeout, int kSearchTimeout, int nodeNotFound) {
		this.sendNum = sendNum;
		this.kSearchNum = kSearchNum;
		this.sendNumTimeout = sendNumTimeout;
		this.kSearchTimeout = kSearchTimeout;
		this.nodeNotFound = nodeNotFound;
	}
	
	public int getSendNum() {
		return sendNum;
	}
	
	public int getKSearchNum() {
		return kSearchNum;
	}
	
	public int getSendNumTimeout() {
		return sendNumTimeout;
	}
	
	public int getKSearchTimeout() {
		return kSearchTimeout;
	}
	
	public int getNodeNotFound() {
		return nodeNotFound;
	}
	
	public void addSendNum(int val) {
		sendNum += val;
	}
	
	public void addKSearchNum(int val) {
		kSearchNum += val;
	}
	
	public void addSendNumTimeout(int val) {
		sendNumTimeout += val;
	}
	
	public void addKSearchTimeout(int val) {
		kSearchTimeout += val;
	}
	
	public void addNodeNotFound(int val) {
		nodeNotFound += val;
	}
	
	public void addData(NodeTest node) {
		sendNum += node.getSendNum();
		kSearchNum += node.getKSearchNum();
		sendNumTimeout += node.getSendNumTimeout();
		kSearchTimeout += node.getKSearchTimeout();
		nodeNotFound += node.getNodeNotFoundNum();
	}
}
